#include"process.h"
#include<unistd.h>
//场景
double target_file_size = 1024.0;//M,目标文件大小
double speed = 1.0;//M

void Download(double size, double split)
{
  double current_total = 0.0;
  while(current_total < size)
  {
    //下载我们用sleep来进行模拟
    usleep(2000);//代表一次下载
    current_total += split;
    FlushProcess(size, current_total);//process进度条不能一次刷新完，根据具体的进度，来进行刷新
  }
}


int main()
{
  // Process();
  printf("下载中");
  Download(target_file_size, speed);

  printf("下载中");
  Download(100.0, 1.0);
  printf("下载中");
  Download(312.0, 10.0);
  printf("下载中");
  Download(10234.0, 5.0);
  return 0;
}
